#ifndef __GSM_CNS01_H__
#define __GSM_CNS01_H__

#include "vbb_GSM.h"
#include "fw/vbb_Utils.h"
#include "vbb_FirmwareUtils.h"

void GSM_Reboot_CNS01(void);
void GSM_SetUp_CNS01(void);
bool GSM_OpenGPRS_CNS1(void);
bool vbb_GSM_PostData_CNS01(char * ResponseBuffer, char * DataBuffer, unsigned int DataLength, unsigned int * ReceiveLength, const char * URL);
bool GSM_OpenConnection_CNS01(const char * URL);
char GSM_IsConnectionOpenned_CNS01(void);
bool GSM_PrepareToSendDataToBuffer_CNS01(char * SendBuffer, int SendLength, int * SentCount);
bool GSM_SendDataToBufferUpdate_CNS01(char * SendBuffer, int SendLength, int * SentCount);
bool GSM_WaitForConnecionClosed_CNS01(void);

char GSM_NetworkSet_CNS01(void);
bool GSM_GPRS_IsOpen_CNS01(void);
char GSM_GPRS_Open_CNS01(void);
char GSM_GPRS_WaitForOpen_CNS01(void);
bool GSM_TCP_IsOpen_CNS01(void);
char GSM_TCP_Opened_CNS01(const char * Document, char * DataBuffer, int * DataSize, char * TmpBuffer);
char GSM_TCP_Open_CNS01(const char * ServerAddr);
char GSM_TCP_WaitForOpen_CNS01(void);
char GSM_TCP_DataWaitForReady_CNS01(void);
int GSM_TCP_DataPrepareSend_CNS01(char * DataBuffer, int DataSize);
int GSM_TCP_DataSendData_CNS01(char * DataBuffer, int SendSize);
char GSM_TCP_WaitForServerClosed_CNS01(void);
char GSM_TCP_CloseClient_CNS01(void);
int GSM_Communication_ReceivingData_CNS01(char * Buffer);
bool GSM_IsOn_CNS01(void);
bool GSM_IsOff_CNS01(void);
bool GSM_Ready_CNS01(void);
void GSM_Reboot(void);

#endif

